home *** CD-ROM | disk | FTP | other *** search
- Path: news.internetMCI.com!news-admin
- From: rknapp@mcimail.com (Rich Knapp)
- Newsgroups: comp.lang.c++
- Subject: Re: Faster FILE subroutines in standard C?
- Date: 10 Jan 1996 19:08:52 GMT
- Organization: InternetMCI
- Message-ID: <4d12s4$js8@news.internetmci.com>
- References: <Pine.A32.3.91.960103111942.52249A-100000-100000-100000-100000-100000@afep.yorku.ca>
- Reply-To: rknapp@mcimail.com (Rich Knapp)
- NNTP-Posting-Host: 166.35.209.252
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <Pine.A32.3.91.960103111942.52249A-100000-100000-100000-100000-100000@afep.yorku.ca>, Ken <ken@afep.yorku.ca> writes:
- >
- >I found that I was able to get 3-4 time faster performance by using good
- >old ANSI C file accessing routines (like fgets, fseek, ftell, ...etc.)
- >instead of C++ streams (like ifstream::getline, fstream::seekg, ...etc.)
- >I wrote the program originally in C++ (a simple little phonebook for my
- >own use) and it took about 9 seconds to scan a 100Kb file for a 3 byte
- >string!!! Fed up, I rewrote it in C and voila! Now it takes 2 secs!
- >I'm using Borland C++ v2.0.
- >
-
- Ken,
-
- You might try another compiler than Borland. Other work I've done and
- discussions with other developers have highlighted BI's implementation of
- streams in the early compilers is not so good.
-
- If you want, I can work up an example between my Turbo C++ 3.0 and
- WatCom C++ 10.5 but I don't know if that will help you any.
-
- Rich
-